<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="panel-heading">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#one" data-toggle="tab">{:__('基础信息')}</a></li>
            <li><a href="#two" data-toggle="tab">{:__('配置信息')}</a></li>
        </ul>
    </div>
    <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade active in" id="one">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="c-name" class="form-control" data-rule="required" name="row[name]" type="text" value="{$row.name|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="c-desc" class="form-control" data-rule="required" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label for="c-category_id" class="control-label col-xs-12 col-sm-2">{:__('Category')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="c-category_id" data-rule="required" data-multiple="false"   data-source="user/teacher_category/selectpage" class="form-control selectpage" name="row[category_id]" data-params='{"custom[switch]":1}' type="text" value="{$row.category_id|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label for="c-tags" class="control-label col-xs-12 col-sm-2">{:__('Tags')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="c-tags" data-rule="" data-multiple="true"   data-source="course/tags/selectpage" class="form-control selectpage" name="row[tags]" data-params='{"custom[switch]":1}' type="text" value="{$row.tags|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <div class="input-group">
                        <input id="c-image" data-rule="required" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-image"></span>
                    </div>
                    <ul class="row list-inline faupload-preview" id="p-image"></ul>
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="control-label col-xs-12 col-sm-2">{:__('Original_price')}:</label>-->
<!--                <div class="col-xs-12 col-sm-4">-->
<!--                    <input id="c-original_price" class="form-control" data-rule="required" step="0.01" name="row[original_price]" type="number" value="{$row.original_price|htmlentities}">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Price')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="c-price" class="form-control" data-rule="required" step="0.01" name="row[price]" type="number" value="{$row.price|htmlentities}">
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Class_hour')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="c-class_hour" data-rule="required" class="form-control" name="row[class_hour]" type="number" value="{$row.class_hour|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Is_recommend')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input  id="c-is_recommend" name="row[is_recommend]" type="hidden" value="{$row.is_recommend}">
                    <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-is_recommend" data-yes="1" data-no="0" >
                        <i class="fa fa-toggle-on text-success {eq name="$row.is_recommend" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
                    </a>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Switch')}:</label>
                <div class="col-xs-12 col-sm-8">

                    <input  id="c-switch" name="row[switch]" type="hidden" value="{$row.switch}">
                    <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-switch" data-yes="1" data-no="0" >
                        <i class="fa fa-toggle-on text-success {eq name="$row.switch" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
                    </a>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('专属客服')}:</label>
                <div class="col-xs-12 col-sm-4">
                    <input id="c-wechat_uesr_id" data-rule="" data-source="user/user/selectpage" data-field="nickname" class="form-control selectpage" name="row[wechat_uesr_id]" type="text" data-params='{"custom[user_type]":"2","custom[wechat_url][0]":"neq","custom[wechat_url][1]":""}' data-search-field="nickname,mobile" data-format-item="{nickname} - {mobile}" value="{$row.wechat_uesr_id|htmlentities}">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
                </div>
            </div>
        </div>
        <div class="tab-pane fade" id="two">
            <ul class="nav nav-tabs">
                {foreach $defaultConfig as $school}
                <li {if condition="($first_school_id == $school['school_id'])"} class="active" {/if}><a href="#config_{$school['school_id']}" data-toggle="tab">{$school['school_name']}</a></li>
                {/foreach}

            </ul>

            <div id="configTabContent" class="tab-content">
                {foreach $row.config as $school}
                <div class="tab-pane fade {if condition="($first_school_id == $school['school_id'])"} active in {/if} " id="config_{$school['school_id']}">
                <div class="panel panel-info">
                    <div class="panel-heading">
                        {$school['school_name']}:
                    </div>
                    <p style="padding: 15px">
                        开启:<input type="checkbox" class="school_checkbox" name="row[config][{$school['school_id']}][switch]" data-id="{$school['school_id']}" {if condition='$school.switch == 1'} checked="checked" {/if}  value="1">
                    </p>
                    <div class="panel-body school_{$school['school_id']} {if condition='$school.switch == 0'} hidden {/if}">
                        <div class="row">
                            <div class="col-xs-12 col-sm-12">
                                {foreach $school['data'] as $classes}
                                <p>{$classes['classes_name']}:
                                    开启:<input type="checkbox" class="classes_checkbox" name="row[config][{$school['school_id']}][classes][{$classes['classes_id']}][switch]" data-id="{$school['school_id']}_{$classes['classes_id']}" {if condition='$classes.switch == 1'} checked="checked" {/if} value="1">
                                </p>
                                <div class="panel-body classes_{$school['school_id']}_{$classes['classes_id']} {if condition='$classes.switch == 0'} hidden {/if}">
                                    {foreach $classes['data'] as $data_item}
                                    <p>{$data_item['name']}:</p>
                                    {foreach $data_item['config'] as $config_item}
                                    <div style="display: flex;align-items: center;height: 44px;">
                                        <div style="margin-right: 15px;">
                                            {$config_item['start']} - {$config_item['end']}&nbsp;&nbsp;开启:<input type="checkbox" class="time_checkbox" name="row[config][{$school['school_id']}][classes][{$classes['classes_id']}][time][{$data_item['w']}_{$config_item['time_no']}][switch]" data-id="{$school['school_id']}_{$classes['classes_id']}_{$data_item['w']}_{$config_item['time_no']}" {if condition='$config_item.switch == 1'} checked="checked" {/if} value="1">
                                        </div>
                                        <div class="classes_{$school['school_id']}_{$classes['classes_id']}_{$data_item['w']}_{$config_item['time_no']} {if condition='$config_item.switch == 0'} hidden {/if}">
                                            <input style="width: 150px" data-rule="" data-source="user/teacher/selectpage" class="form-control selectpage" name="row[config][{$school['school_id']}][classes][{$classes['classes_id']}][time][{$data_item['w']}_{$config_item['time_no']}][teacher_id]" data-field="nickname" data-params='{"custom[school_id]":"{$school.school_id}","custom[user_type]":"2"}' type="text" value="{$config_item.teacher_id}" placeholder="选择老师">
                                            <input style="width: 150px" data-rule=""  class="form-control" name="row[config][{$school['school_id']}][classes][{$classes['classes_id']}][time][{$data_item['w']}_{$config_item['time_no']}][student_num]" type="text" value="{$config_item.student_num}" placeholder="学员数量">
                                        </div>
                                    </div>
                                    {/foreach}
                                    {/foreach}
                                </div>

                                {/foreach}
                            </div>
                        </div>

                    </div>

                </div>
                </div>
                {/foreach}
            </div>

        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
